const state = () => ({
  sidebarCollapsed: false
})

const mutations = {
  TOGGLE_SIDEBAR: state => {
    state.sidebarCollapsed = !state.sidebarCollapsed
  },
  SET_SIDEBAR_COLLAPSE: (state, collapsed) => {
    state.sidebarCollapsed = collapsed
  }
}

const actions = {
  toggleSideBar({ commit }) {
    commit('TOGGLE_SIDEBAR')
  },
  setSidebarCollapse({ commit }, collapsed) {
    commit('SET_SIDEBAR_COLLAPSE', collapsed)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
} 